package com.mymarkdown.app.service.impl;

import com.mymarkdown.app.service.UserOperationFileService;

import java.io.File;
import java.util.Collection;
import java.util.Iterator;
import java.util.Objects;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.TimeUnit;


/**
 * @author zenglun
 * @date 2021/12/15 9:01 上午
 * @description: TODO
 */
public abstract class AbstractUserOperationFileService implements UserOperationFileService {

    protected BlockingQueue<File> fileBlockingQueue;

    public AbstractUserOperationFileService(BlockingQueue<File> fileBlockingQueue) {
        if (Objects.isNull(fileBlockingQueue)) {
            throw new NullPointerException("初始化构造队列不能为空!");
        }
        this.fileBlockingQueue = fileBlockingQueue;
    }

    @Override
    public boolean add(File file) {
        throw new UnsupportedOperationException("不被允许的操作");
    }

    @Override
    public boolean offer(File file) {
        throw new UnsupportedOperationException("不被允许的操作");
    }


    @Override
    public File poll() {
        throw new UnsupportedOperationException("不被允许的操作");
    }

    @Override
    public File element() {
        throw new UnsupportedOperationException("不被允许的操作");
    }

    @Override
    public boolean offer(File file, long timeout, TimeUnit unit) throws InterruptedException {
        throw new UnsupportedOperationException("不被允许的操作");
    }


    @Override
    public int remainingCapacity() {
        throw new UnsupportedOperationException("不被允许的操作");
    }

    @Override
    public boolean remove(Object o) {
        throw new UnsupportedOperationException("不被允许的操作");
    }

    @Override
    public boolean containsAll(Collection<?> c) {
        throw new UnsupportedOperationException("不被允许的操作");
    }

    @Override
    public boolean addAll(Collection<? extends File> c) {
        throw new UnsupportedOperationException("不被允许的操作");
    }

    @Override
    public boolean removeAll(Collection<?> c) {
        throw new UnsupportedOperationException("不被允许的操作");
    }

    @Override
    public boolean retainAll(Collection<?> c) {
        throw new UnsupportedOperationException("不被允许的操作");
    }

    @Override
    public boolean contains(Object o) {
        throw new UnsupportedOperationException("不被允许的操作");
    }

    @Override
    public Iterator<File> iterator() {
        throw new UnsupportedOperationException("不被允许的操作");
    }

    @Override
    public Object[] toArray() {
        throw new UnsupportedOperationException("不被允许的操作");
    }

    @Override
    public <T> T[] toArray(T[] a) {
        throw new UnsupportedOperationException("不被允许的操作");
    }

    @Override
    public int drainTo(Collection<? super File> c) {
        throw new UnsupportedOperationException("不被允许的操作");
    }

    @Override
    public int drainTo(Collection<? super File> c, int maxElements) {
        throw new UnsupportedOperationException("不被允许的操作");
    }
}
